<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
////    return $request->user();
//    return 1;
//});

use Illuminate\Routing\Router;
//
//Route::group([
////    'prefix'        => 'api',
//    'namespace'     => 'api',
//    'middleware'    => ['api'],
//], function (Router $router) {
//    $router->get('/user', 'UserController@index');
////    $router->get('/', 'HomeController@index')->name('admin.home');
////    $router->resource('users', UserController::class);
//});


// 用户认证
Route::prefix('v1/auth')
    ->namespace('api\auth')
    ->group(base_path('routes/auth.php'));

// 基础通用接口
Route::prefix('v1/base')
    ->namespace('api\base')
    ->group(base_path('routes/base.php'));

//用户模块
Route::prefix('v1/user')
    ->namespace('api\user')
    ->group(base_path('routes/user.php'));


Route::prefix('v1/pay')
    ->namespace('api\pay')
    ->group(base_path('routes/pay.php'));


Route::prefix('v1/goods')
    ->namespace('api\goods')
    ->group(base_path('routes/goods.php'));

Route::prefix('v1/shop')
    ->namespace('api\shop')
    ->group(base_path('routes/shop.php'));


//支付资金模块
Route::prefix('v1/funds')
    ->namespace('api\funds')
    ->group(base_path('routes/funds.php'));

Route::prefix('v1/posts')
    ->namespace('api\posts')
    ->group(base_path('routes/posts.php'));


Route::prefix('v1/orders')
    ->namespace('api\orders')
    ->group(base_path('routes/orders.php'));


Route::prefix('v1/common')
    ->namespace('api\common')
    ->group(base_path('routes/common.php'));

Route::prefix('v1/news')
    ->namespace('api\news')
    ->group(base_path('routes/news.php'));

Route::prefix('v1/activity')
    ->namespace('api\activity')
    ->group(base_path('routes/activity.php'));

Route::prefix('v1/access')
    ->namespace('api\access')
    ->group(base_path('routes/access.php'));

Route::prefix('v1/exam')
    ->namespace('api\exam')
    ->group(base_path('routes/exam.php'));